package Chapter08;

import java.util.Calendar;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
public class Demo03 {
    public static void main(String args[]) {
            int year1 = Integer.parseInt(args[0]);
            int month1 = Integer.parseInt(args[1]);
            int day1 = Integer.parseInt(args[2]);
            int year2 = Integer.parseInt(args[3]);
            int month2 = Integer.parseInt(args[4]);
            int day2 = Integer.parseInt(args[5]);
            try {
                LocalDate date1 = LocalDate.of(year1, month1, day1);
                LocalDate date2 = LocalDate.of(year2, month2, day2);
                long daysBetween = ChronoUnit.DAYS.between(date1, date2);
                System.out.println("天数间隔： " + daysBetween);
            } catch (Exception e) {
                System.out.println("输入的日期格式不正确");
            }
    }

}

